<?php
include '../inc-config.php';
if(isset($_POST['submit']))
{    
	echo "<link rel='stylesheet' href='templates/default/style.css' type='text/css'>"; //chooses which template to display
	$email = $_POST['email'];
	$getinfo = "SELECT * from b_users where email='$email'";
	$getinfo2 = mysql_query($getinfo, $forum) or die("Could not get info");
	$getinfo3 = mysql_fetch_array($getinfo2);
	if($getinfo3)
	{
		mail($email,"Forum password change--step one","Please paste the following link in your browser to reset your forum password $boardpath/changepassword.php?ID=$getinfo3[userID]&keyed=$getinfo3[password]");   
		echo "Instruction for changing your password have been mailed to you.";
	}
	else
	{
		echo "<table class='maintable'>";
		echo "<tr class='headline'><td><center>Retrieve Password</center></td></tr>";
		echo "<tr class='forumrow'><td><center>";
		echo "There is not a user with that e-mail address";
		echo "</center></td></tr></table>";
	}
}
else
{
	echo "<table class='maintable'>";
	echo "<tr class='headline'><td><center>Retrieve Password</center></td></tr>";
	echo "<tr class='forumrow'><td><center>";
	echo "<table border='0'>";
	echo "<form method='POST' action='getpassword.php'>";
	echo "<tr class='forumrow'><td>Your e-mail:</td><td><input type='text' name='email' length='15'></td></tr>";
	echo "<tr class='forumrow'><td></td><td><input type='submit' name='submit' value='submit'></td></tr></table>";
	echo "</td></tr></table>";
}
?>